#-*- coding: utf-8 -*-
from threading import local

_thread_locals = local()

def get_user():
    try:
        return _thread_locals.user
    except:
        return None

def set_user(u):
    _thread_locals.user = u